import { request } from './conn'
import { servicePath } from './urls'
export default {
  // 登录
  login: (params, config) => request('post', `${servicePath.auth}/auth/login/login`, params, config),
  // 退出
  logout: (params, config) => request('post', `${servicePath.auth}/auth/login/loginOut`, params, config),
  // 验证码
  captcha: (params, config) => request('get', `${servicePath.auth}/auth/login/captcha`, params, config),
  // 主页修改密码
  changePwd: (params, config) => request('put', `${servicePath.uc}/home/homePage/updatePassword`, params, config),
  // 获取用户信息
  getUserInfo: (params, config) => request('get', `${servicePath.uc}/home/homePage/getUserInfo`, params, config),
  // 用户列表
  userPage: (params, config) => request('get', `${servicePath.uc}/uc/user/list`, params, config),
  // 根据部门ID用户列表
  userPageByOrgId: (params, config) => request('get', `${servicePath.uc}/uc/user/pageList`, params, config),
  // 用户详情
  userGetById: (params, config) => request('get', `${servicePath.uc}/uc/user/getById/`, params, config),
  // 用户保存
  userSave: (params, config) => request('post', `${servicePath.uc}/uc/user/insert`, params, config),
  // 用户更新
  userUpdate: (params, config) => request('put', `${servicePath.uc}/uc/user/update`, params, config),
  // 用户删除
  userDelete: (params, config) => request('get', `${servicePath.uc}/uc/user/delete`, params, config),
  // 批量删除
  deleteBatch: (params, config) => request('post', `${servicePath.uc}/uc/user/deleteBatch`, params, config),
  // 重置密码
  resetPwd: (params, config) => request('get', `${servicePath.uc}/uc/user/resetPwd`, params, config),
  // 冻结&解冻用户
  userFrozen: (params, config) => request('put', `${servicePath.uc}/uc/user/frozenBatch`, params, config),
  // 根据角色ID查询用户角色关系
  queryUserRoleByRoleId: (params, config) => request('get', `${servicePath.uc}/uc/userRole/queryUserRoleByRoleId`, params, config),
  // 根据角色ID保存角色与用户关系
  saveUserRoleByRoleId: (params, config) => request('post', `${servicePath.uc}/uc/userRole/saveUserRoleByRoleId`, params, config),
  // 根据用户ID查询角色
  getRolesByUserId: (id, config) => request('get', `${servicePath.uc}/sc/role/queryRolesByUserId/?userId=${id}`, null, config),
  // 根据岗位ID查询角色
  getRolesByPositionId: (id, config) => request('get', `${servicePath.uc}/sc/role/queryRolesByPositionId/?positionId=${id}`, null, config),
  // 角色列表
  rolePage: (params, config) => request('get', `${servicePath.uc}/sc/role/list`, params, config),
  // 角色详情
  roleGetById: (id, config) => request('get', `${servicePath.uc}/sc/role/getById/?id=${id}`, null, config),
  // 角色保存
  roleInsert: (params, config) => request('post', `${servicePath.uc}/sc/role/insert`, params, config),
  // 角色更新
  roleUpdate: (params, config) => request('put', `${servicePath.uc}/sc/role/update`, params, config),
  // 角色删除
  roleDel: (id, config) => request('delete', `${servicePath.uc}/sc/role/delete/?id=${id}`, null, config),
  // 所有角色
  getAllRole: (params, config) => request('get', `${servicePath.uc}/sc/role/allList`, params, config),
  // 根据角色ID查询权限关系
  queryRolePermsByRoleId: (params, config) => request('get', `${servicePath.uc}/sc/rolePermission/queryRolePermsByRoleId`, params, config),
  // 根据角色ID保存角色与权限关系
  saveRolePermission: (params, config) => request('post', `${servicePath.uc}/sc/rolePermission/saveRolePermission`, params, config),
  // 字典列表
  dictPage: (params, config) => request('post', `${servicePath.uc}/base/dict/list`, params, config),
  // 字典新增
  dictInsert: (params, config) => request('post', `${servicePath.uc}/base/dict/insert`, params, config),
  // 字典修改
  dictUpdate: (params, config) => request('put', `${servicePath.uc}/base/dict/update`, params, config),
  // 字典删除
  dictDelete: (id, config) => request('delete', `${servicePath.uc}/base/dict/delete/?id=${id}`, null, config),
  // 所有字典信息
  getAllDict: (params, config) => request('get', `${servicePath.uc}/base/dict/allList`, params, config),
  // 字典列表
  getDictById: (id, config) => request('get', `/api/base/dict/queryById/?id=${id}`, null, config),
  // 字典列表
  dictItemPage: (params, config) => request('post', `${servicePath.uc}/base/dictitem/list/page`, params, config),
  // 字典新增
  dictItemInsert: (params, config) => request('post', `${servicePath.uc}/base/dictitem/insert`, params, config),
  // 字典修改
  dictItemUpdate: (params, config) => request('put', `${servicePath.uc}/base/dictitem/update`, params, config),
  // 字典删除
  dictItemDelete: (id, config) => request('delete', `/api/base/dictitem/delete/?id=${id}`, null, config),
  // 根据DictItemcode查询
  getDictItemCode: (dictItemCode, config) => request('get', `/api/base/dictitem/list/byCode/${dictItemCode}`, null, config),
  // 根据多个DictItemCode批量获取字典集列表
  getDictItemCodes: (params, config) => request('post', `${servicePath.uc}/base/dictitem/list/codes`, params, config),
  // 所有字典信息
  getAllDictItem: (params, config) => request('post', `${servicePath.uc}/base/dictitem/list/all`, params, config),
  // 字典列表
  getDictItemById: (id, config) => request('get', `/api/base/dictitem/queryById/?id=${id}`, null, config),
  // 根据父ID查询菜单列表
  getPermListByParentId: (params, config) => request('get', `${servicePath.uc}/sc/permission/queryListByParentId`, params, config),
  // 菜单新增
  permsInsert: (params, config) => request('post', `${servicePath.uc}/sc/permission/insert`, params, config),
  // 菜单修改
  permsUpdate: (params, config) => request('put', `${servicePath.uc}/sc/permission/update`, params, config),
  // 菜单删除
  permsDelete: (id, config) => request('delete', `/api/sc/permission/delete/?id=${id}`, null, config),
  // 组织机构树构建
  getOrgByParentId: (params, config) => request('get', `${servicePath.uc}/uc/organization/queryListByParentId`, params, config),
  // 组织机构列表
  orgGetById: (id, config) => request('get', `/api/uc/organization/queryById/?id=${id}`, null, config),
  // 组织机构列表
  orgPage: (params, config) => request('get', `${servicePath.uc}/uc/organization/pageList`, params, config),
  // 组织机构新增
  orgInsert: (params, config) => request('post', `${servicePath.uc}/uc/organization/insert`, params, config),
  // 组织机构修改
  orgUpdate: (params, config) => request('put', `${servicePath.uc}/uc/organization/update`, params, config),
  // 组织机构删除
  orgDelete: (id, config) => request('delete', `/api/uc/organization/delete/?id=${id}`, null, config),
  // 组织机构类型列表
  orgTypePage: (params, config) => request('get', `${servicePath.uc}/uc/orgType/pageList`, params, config),
  // 组织机构类型详情
  orgTypeGetById: (id, config) => request('get', `/api/uc/orgType/getById/?id=${id}`, null, config),
  // 组织机构类型保存
  orgTypeInsert: (params, config) => request('post', `${servicePath.uc}/uc/orgType/insert`, params, config),
  // 组织机构类型更新
  orgTypeUpdate: (params, config) => request('put', `${servicePath.uc}/uc/orgType/update`, params, config),
  // 组织机构类型删除
  orgTypeDelete: (id, config) => request('delete', `api/uc/orgType/delete/?id=${id}`, null, config),
  // 组织机构类型列表
  orgTypeList: (params, config) => request('get', `${servicePath.uc}/uc/orgType/allList`, params, config),

  // 职务列表
  titlePage: (params, config) => request('get', `${servicePath.uc}/uc/title/pageList`, params, config),
  // 职务详情
  titleGetById: (id, config) => request('get', `/api/uc/title/getById/?id=${id}`, null, config),
  // 职务保存
  titleInsert: (params, config) => request('post', `${servicePath.uc}/uc/title/insert`, params, config),
  // 职务更新
  titleUpdate: (params, config) => request('put', `${servicePath.uc}/uc/title/update`, params, config),
  // 职务删除
  titleDelete: (id, config) => request('delete', `${servicePath.uc}/uc/title/delete/?id=${id}`, null, config),
  // 职务列表
  titleList: (params, config) => request('get', `${servicePath.uc}/uc/title/allList`, params, config),
  // 所有职务
  getAllTitle: (params, config) => request('get', `${servicePath.uc}/uc/title/allList`, params, config),
  // 岗位列表
  positionPage: (params, config) => request('get', `${servicePath.uc}/uc/position/pageList`, params, config),
  // 岗位详情
  positionGetById: (id, config) => request('get', `${servicePath.uc}/uc/position/getById/?id=${id}`, null, config),
  // 岗位保存
  positionInsert: (params, config) => request('post', `${servicePath.uc}/uc/position/insert`, params, config),
  // 岗位更新
  positionUpdate: (params, config) => request('put', `${servicePath.uc}/uc/position/update`, params, config),
  // 岗位删除
  positionDelete: (id, config) => request('delete', `${servicePath.uc}/uc/position/delete/?id=${id}`, null, config),
  // 用于选择岗位列表
  selectPositionPage: (params, config) => request('get', `${servicePath.uc}/uc/position/selectPositionPage`, params, config)
}
